import React from "react";
import { TopVipSd } from "@/components/main/index/styled";
import { connect } from "react-redux";
import { loadVipHomeSchedularDataAsync } from "@/components/main/index/actionCreator";

class TopVip extends React.Component {
  constructor() {
    super();
    this.state = {
      data: ""
    };
  }
  render() {
    return (
      <div>
        <TopVipSd>
          <div className="topvip_title">
            <span>优先购票</span>
            <i>VIP+会员尊享权益 </i>
            <b>99元/年</b>
          </div>
          <div className="topvip_content">
            <img src={this.state.data.pic} alt="" />
            <div className="topvip_right">
              <p className="topvip_schedular_name">
                {this.state.data.schedular_name}
              </p>
              <p className="venue_name">
                {this.state.data.city_name}&nbsp;&nbsp;|&nbsp;&nbsp;
                {this.state.data.venue_name}
              </p>
              <p className="pre_time">
                <span className="time">{this.state.data.pre_time}</span>
                <i>开始</i>
                <span className="warn">开售提醒</span>
              </p>
            </div>
          </div>
        </TopVipSd>
      </div>
    );
  }
  componentDidMount() {
    loadVipHomeSchedularDataAsync(res => {
      var data = res.val.priorList[0];
      this.setState({ data });
    });
  }
}
const mapStateToProps = state => {
  return {};
};
const mapDispatchToProps = dispatch => {
  return {};
};
export default connect(mapStateToProps, mapDispatchToProps)(TopVip);
